11.3 Custom API resource configuration files

Custom API resource configuration files each contain the details for a single API resource, which is identified by its Name. If the Name already exists in the appsettings.Production.json or appsettings.json file, the details from the custom API resource configuration file completely replace the existing settings for that API resource; if the Name does not exist, the API resource is added to the configuration for the web service.

Note: You can continue to use the appsettings.Production.json file for your API resource configuration if you want, but you are recommended to move any API resources you have created into their own custom API resource configuration files.

To create a custom API resource configuration file:

  1. On the MyID web server, navigate to the CustomAPIResources folder.

    By default, this is:

    C:\Program Files\Intercede\MyID\web.oauth2\CustomAPIResources\

    If this folder does not already exist, create it.

  2. In a text editor, create a .json file to contain your API resource configuration.

    You can use any filename with a .json extension; you are recommended to use the name you have provided for the API resource as the filename.

    You can create a custom .json file for each API resource that you want to add. You can include only one API resource in each file, but you can have multiple files if you need multiple API resources. These API resources are added to the APIResources array from the appsettings.json file. You must use a unique Name; if you use the same Name in a custom file as an already existing API resource in the appsettings file, the information from the custom file completely replaces the information in the appsettings.json or appsettings.Production.json override file.

    The order of precedence is:

    • any .json file in the CustomAPIResources folder.

    • appsettings.Production.json

    • appsettings.json

    Note: The appsettings.Production.json file overrides the appsettings.json file not by using the Name, but by the index of the entry in the APIResources array. For this reason, you are recommended not to use the appsettings.Production.json file to provide the details of custom API resources, but to use separate files in the CustomAPIResources folder instead.